﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SQLDataUploadHelper.models
{
    /// <summary>
    /// 上送请求参数
    /// {"tableName": "xxx","data": [{"id": "11111"},{"id": "222"}]}
    /// </summary>
    internal class UploadRequest
    {
        /// <summary>
        /// 表名
        /// </summary>
        [JsonProperty(PropertyName = "tableName")]
        public string? TableName { get; set; }

        /// <summary>
        /// 表数据
        /// </summary>
        [JsonProperty(PropertyName = "data")]
        public List<JObject>? Data { get; set; }

        public string toJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.None);
        }
    }
}
